package com.wontube.client.extension.log;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.wontube.client.log.MinLoggerFactory.MinLogger;


/**
 * @author yuechao
 * 
 */
public final class Slf4JLogger extends MinLogger {
	private Logger logger;

	public Slf4JLogger() {
		this(null);
	}
	
	public Slf4JLogger(Logger logger) {
		this.logger = logger;
	}

	@Override
	public boolean isDebugEnabled() {
		return this.logger.isDebugEnabled();
	}

	@Override
	public boolean isInfoEnabled() {
		return this.logger.isInfoEnabled();
	}

	@Override
	public boolean isTraceEnabled() {
		return this.logger.isTraceEnabled();
	}

	@Override
	public boolean isWarnEnabled() {
		return this.logger.isWarnEnabled();
	}

	@Override
	public boolean isErrorEnabled() {
		return this.logger.isErrorEnabled();
	}

	@Override
	public MinLogger getLogger(Class<?> clazz) {
		Logger logger = LoggerFactory.getLogger(clazz);
		return new Slf4JLogger(logger);
	}

	@Override
	public void error(String message) {
		this.logger.error(message);
	}

	@Override
	public void warn(String message) {
		this.logger.warn(message);
	}

	@Override
	public void info(String message) {
		this.logger.info(message);
	}

	@Override
	public void debug(String message) {
		this.logger.debug(message);
	}

	@Override
	public void trace(String message) {
		this.logger.trace(message);
	}
}
